package cn.jsj.cases.dispose;

import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * 根据案件类别进行分类查看报表信息
 * @author LI
 *
 */
 public class CaseTypeChartLook extends javax.servlet.http.HttpServlet implements javax.servlet.Servlet {
	 public void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		// 调试信息
		 cn.jsj.utils.SysLogger.PrintInfo("案件类别报表");

		 //获取参数
		 String startTime=request.getParameter("caseTypeChartStartTime").trim();
		 String  endTime=request.getParameter("caseTypeChartEndTime").trim();
		 int caseType=Integer.parseInt(request.getParameter("caseTypeChart"));

		 //调试信息
		 cn.jsj.utils.SysLogger.PrintInfo("canshu---------->"+startTime+"  "+endTime+"  "+caseType);

		 //新建参数类
		 cn.jsj.bgtodb.CaseTypeChartProperty ctcp=new cn.jsj.bgtodb.CaseTypeChartProperty();
		 //赋值
		 ctcp.setCaseTypeNumber(caseType);
		 ctcp.setEndTime(cn.jsj.utils.TimeDispose.transferDate(endTime));
		 ctcp.setStartTime(cn.jsj.utils.TimeDispose.transferDate(startTime));

		 //查看报表信息
		 cn.jsj.dao.TblCaseInfoDAO tcid=new cn.jsj.dao.TblCaseInfoDAO();
		 		String chartResult=tcid.getCaseTypeChartInfo(ctcp);

		 		//输出流
		 		java.io.PrintWriter out=response.getWriter();

		 		out.println("{message:'"+chartResult+"'}");
		 		out.flush();
		 		out.close();
	}
}